package Code_20200407;

import java.util.Scanner;

public class WangEasy {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int len = in.nextInt();
        int[] test = new int[len];
        for (int i = 0; i < len; i++) {
            test[i] = in.nextInt();
        }
        int[] temp = new int[len - 1];
        for (int i = 0, j = 1; j < len - 1; i++, j++) {
            temp[i] = test[j] - test[i];
        }

        int res = gcd(temp);
        System.out.println(res);

    }
    public static int gcd(int[] a) {
        int res = a[0];
        int t;
        for (int i = 0; i < a.length - 1; i++) {
            t = 0;
            while (a[i + 1] != 0) {
                t = a[i + 1];
                a[i + 1] = res % a[i + 1];
                res = t;
            }
        }
        if(res == 0) res = -1;
        return res;
    }
}
